refactor(FR-2847): split admin deployment detail route under /admin-deployments/:id#7312
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage Report for react-coverage (./react)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
Refactors the admin deployment detail navigation so admins can view deployment details under the admin-scoped URL space (/admin-deployments/:deploymentId), keeping breadcrumbs/back navigation within the admin context while reusing the existing shared DeploymentDetailPage.
Changes:
- Added a nested admin deployment detail route at
/admin-deployments/:deploymentIdthat rendersDeploymentDetailPage. - Updated the legacy
/admin-serving/:serviceIdredirect to point to/admin-deployments/:serviceId. - Updated admin-facing navigation links (admin deployment list row click, admin endpoint list links) to route to
/admin-deployments/:id.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| react/src/routes.tsx | Adds /admin-deployments/:deploymentId route and retargets legacy /admin-serving/:serviceId redirect to the admin-scoped detail route. |
| react/src/pages/AdminDeploymentListPage.tsx | Updates admin deployment list row navigation to go to /admin-deployments/:deploymentId. |
| react/src/components/EndpointList.tsx | Updates admin-mode endpoint name links to point to /admin-deployments/:id instead of the user-scoped route. |
Merge activity
|
…eployments/:id (#7312) Resolves #7310(FR-2847) ## Summary Split the admin-side deployment detail page from the user-side one at the route level. Admins now stay under `/admin-deployments/*` when navigating into a deployment detail, preserving the admin context through breadcrumbs and back navigation. The detail page **component** (`DeploymentDetailPage`) is unchanged — only the route is separated. ## Changes - **`react/src/routes.tsx`** - Add new child route `/admin-deployments/:deploymentId` that mounts the same `DeploymentDetailPage` inside the existing `/admin-deployments` parent route, using the same `BAIErrorBoundary` + `Suspense` pattern as sibling children. - Add `handle: { labelKey: 'webui.menu.DeploymentDetail' }` so the breadcrumb resolves correctly under the admin route. - Update the legacy `/admin-serving/:serviceId` redirect to point to `/admin-deployments/:serviceId` (was `/deployments/:serviceId`), so old admin links keep landing inside the admin URL space. - Update the stale comment that said "/admin-deployments has no nested detail route". - **`react/src/pages/AdminDeploymentListPage.tsx`** — row click now navigates to `/admin-deployments/${id}` instead of `/deployments/${id}`. - **`react/src/components/EndpointList.tsx`** — when rendered with `isAdminMode`, the `BAINameActionCell` `to` prop now points at `/admin-deployments/${endpoint_id}` instead of `/deployments/${endpoint_id}`. (`AdminServingPage` does not navigate to detail directly — it composes `EndpointList` with `isAdminMode`, which is the actual entry point from the legacy admin-serving tab.) ## Out of scope - `DeploymentTagChips.tsx` already branches on `pathname.startsWith('/admin-deployments')` and navigates to the **list** (not detail) for tag filters — unchanged. - `DeploymentConfigurationSection.tsx` (FR-2846) and delete-icon styling (FR-2848) intentionally untouched. ## Verification `bash scripts/verify.sh`: Relay PASS, Lint PASS, Format PASS. TypeScript shows pre-existing errors in `packages/backend.ai-client/src/client.ts` and `react/src/components/DeleteForeverVFolderModalV2.tsx` that are unchanged from `main` and unrelated to FR-2847 (`git diff main HEAD --` confirms).
488cf4b to
802c916
Compare
…7313) Resolves #7309(FR-2846) Stacked on #7312 (FR-2847): the `/admin-deployments/:deploymentId` route this PR's post-delete navigation depends on is added there. Merge bottom-up. ## Summary On the Deployment detail page, replaces the implicit Delete entry-point with an explicit `...` More dropdown next to the Edit button. Delete is moved into that menu and confirmed via `BAIConfirmModalWithInput` (typed-confirmation), navigating back to the appropriate list (`/admin-deployments` for admin context, `/deployments` otherwise) on success. ## Changes - `react/src/components/DeploymentConfigurationSection.tsx` - Add `Dropdown` (More menu) next to Edit in the Basic Information `BAICard` `extra` slot. - Add `DeploymentConfigurationSectionDeleteMutation` (uniquely named to avoid clashing with `DeploymentList.tsx`'s mutation, which is owned by FR-2848). - Use `BAIConfirmModalWithInput` with `confirmText = deploymentName` per `.claude/rules/destructive-confirmation.md`. - Disable Delete while deployment is in destroying states or while the mutation is in flight. - Navigate via `useWebUINavigate` + `useLocation` pathname check (works once stacked on FR-2847). - `resources/i18n/*.json` (21 files): add `button.More` translation key in every supported locale. ## Test Plan - [x] More button (`...`) renders to the right of Edit on the Basic Information card. - [x] Clicking Delete in the More menu opens `BAIConfirmModalWithInput`; OK is disabled until the user types the deployment name. - [x] On confirm, the mutation runs, success toast shows, and the user is navigated back to the list. - [x] When opened from `/admin-deployments/:id` (after FR-2847 merges), navigation lands on `/admin-deployments`. - [x] Failed mutation shows error toast. - [x] All 21 locales include `button.More`. - [x] `bash scripts/verify.sh`: Relay PASS, Lint PASS, Format PASS. TypeScript fails only on pre-existing errors in `packages/backend.ai-client/src/client.ts` and `react/src/components/DeleteForeverVFolderModalV2.tsx` — both reproduce on a clean `main` checkout and are unrelated to this PR.

Resolves #7310(FR-2847)
Summary
Split the admin-side deployment detail page from the user-side one at the route level. Admins now stay under
/admin-deployments/*when navigating into a deployment detail, preserving the admin context through breadcrumbs and back navigation. The detail page component (DeploymentDetailPage) is unchanged — only the route is separated.Changes
react/src/routes.tsx/admin-deployments/:deploymentIdthat mounts the sameDeploymentDetailPageinside the existing/admin-deploymentsparent route, using the sameBAIErrorBoundary+Suspensepattern as sibling children.handle: { labelKey: 'webui.menu.DeploymentDetail' }so the breadcrumb resolves correctly under the admin route./admin-serving/:serviceIdredirect to point to/admin-deployments/:serviceId(was/deployments/:serviceId), so old admin links keep landing inside the admin URL space.react/src/pages/AdminDeploymentListPage.tsx— row click now navigates to/admin-deployments/${id}instead of/deployments/${id}.react/src/components/EndpointList.tsx— when rendered withisAdminMode, theBAINameActionCelltoprop now points at/admin-deployments/${endpoint_id}instead of/deployments/${endpoint_id}. (AdminServingPagedoes not navigate to detail directly — it composesEndpointListwithisAdminMode, which is the actual entry point from the legacy admin-serving tab.)Out of scope
DeploymentTagChips.tsxalready branches onpathname.startsWith('/admin-deployments')and navigates to the list (not detail) for tag filters — unchanged.DeploymentConfigurationSection.tsx(FR-2846) and delete-icon styling (FR-2848) intentionally untouched.Verification
bash scripts/verify.sh: Relay PASS, Lint PASS, Format PASS. TypeScript shows pre-existing errors inpackages/backend.ai-client/src/client.tsandreact/src/components/DeleteForeverVFolderModalV2.tsxthat are unchanged frommainand unrelated to FR-2847 (git diff main HEAD --confirms).